"use strict";
exports.__esModule = true;
// config/log4js.ts
var path = require("path");
// import path from 'path';
// const path = require('path')
// const baseLogPath=path.resolve(__dirname,'../../logs');//日志要写入哪个目录
var baseLogPath = path.resolve('/home/data/www/logs'); //日志要写入哪个目录
var log4jsConfig = {
    appenders: {
        console: {
            type: 'console'
        },
        access: {
            type: 'dateFile',
            filename: "".concat(baseLogPath, "/access/access.log"),
            alwaysIncludePattern: true,
            pattern: 'yyyyMMdd',
            daysToKeep: 60,
            numBackups: 3,
            category: 'http',
            keepFileExt: true
        },
        app: {
            type: 'dateFile',
            filename: "".concat(baseLogPath, "/app-out/app.log"),
            alwaysIncludePattern: true,
            layout: {
                type: 'pattern',
                pattern: '{"date":"%d","level":"%p","category":"%c","host":"%h","pid":"%z","data":\'%m\'}'
            },
            //日志文件按日期切割
            pattern: 'yyyyMMdd',
            daysToKeep: 60,
            numBackups: 3,
            keepFileExt: true
        },
        errorFile: {
            type: 'dateFile',
            filename: "".concat(baseLogPath, "/errors/error.log"),
            alwaysIncludePattern: true,
            layout: {
                type: 'pattern',
                pattern: '{"date":"%d","level":"%p","category":"%c","host":"%h","pid":"%z","data":\'%m\'}'
            },
            //日志文件按日期切割
            pattern: 'yyyyMMdd',
            daysToKeep: 60,
            numBackups: 3,
            keepFileExt: true
        },
        errors: {
            type: 'logLevelFilter',
            level: 'ERROR',
            appender: 'errorFile'
        }
    },
    categories: {
        "default": {
            appenders: ['console', 'app', 'errors'],
            level: 'DEBUG'
        },
        info: { appenders: ['console', 'app', 'errors'], level: 'info' },
        access: { appenders: ['console', 'app', 'errors'], level: 'info' },
        http: { appenders: ['access'], level: 'DEBUG' }
    },
    pm2: true,
    pm2InstanceVar: 'INSTANCE_ID'
};
exports["default"] = log4jsConfig;
